#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long n,m;
char a[505];
long long ans[505][505][5];
const long long MOD=1e9+7;
int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	scanf("%lld%lld",&n,&m);
	scanf("%s",a+1);
	for(long long i=1;i<=n;i++)
	{
		for(long long j=1;j+i-1<=n;j++)
		{
			long long l=j,r=j+i-1;
			if(i<=m)
			{
				long long k=l;
				for(;k<=r;k++)
				{
					if(a[k]=='('||a[k]==')')	break;
				}
				if(k==r+1)	ans[l][r][0]=1;
			}
			for(long long k=l;k<r;k++)
			{
				ans[l][r][1]+=(ans[k+1][r][3]+ans[k+1][r][4])%MOD*ans[l][k][0]%MOD;
				ans[l][r][1]=(ans[l][r][1]>=MOD)?(ans[l][r][1]-MOD):ans[l][r][1];
				ans[l][r][3]+=(ans[k+1][r][1]+ans[k+1][r][3]+ans[k+1][r][4])%MOD*ans[l][k][4]%MOD;
				ans[l][r][3]=(ans[l][r][3]>=MOD)?(ans[l][r][3]-MOD):ans[l][r][3];
			}
			if(!((a[l]=='('||a[l]=='?')&&(a[r]==')'||a[r]=='?')))	continue;
			ans[l][r][4]=(ans[l+1][r-1][0]+ans[l+1][r-1][1]+ans[l+1][r-1][2]+ans[l+1][r-1][3]+ans[l+1][r-1][4])%MOD;
			for(long long k=l+1;k<r-1;k++)
			{
				ans[l][r][4]+=(ans[l+1][k][3]+ans[l+1][k][4])%MOD*ans[k+1][r-1][0]%MOD;
				ans[l][r][4]=(ans[l][r][4]>=MOD)?(ans[l][r][4]-MOD):ans[l][r][4];
			}
			if(l==r-1)	ans[l][r][4]=1;
		}
	}
	cout<<(ans[1][n][3]+ans[1][n][4])%MOD;
	return 0;
}

